package com.xdf.zipperdye.controller;

import com.xdf.zipperdye.service.BillTypeService;
import com.xdf.zipperdye.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "单据类型")
@CrossOrigin
@RestController
@RequestMapping("/billType")
public class BillTypeController {
    @Autowired
    private BillTypeService service;

    @ApiOperation(value="查询所有，返回数组", notes="查询所有，返回数组", produces="application/json")
    @GetMapping("/selectAll")
    public JsonResult selectAll(){
        return JsonResult.ok(service.selectAll());
    }

    @ApiOperation(value="查询指定仓库下的所有单据类型，返回数组", notes="查询指定仓库下的所有单据类型，返回数组", produces="application/json")
    @GetMapping("/get8Storage/{storage}")
    public JsonResult get8Storage(@PathVariable String storage){
        return JsonResult.ok(service.getBillType8Storage(storage));
    }

}
